import std.stdio;
import std.functional;

class TT(ARGS...)
{
    alias myCB = void delegate(ARGS);
    
    void doCB(ARGS args)
    {
        cb(args);
    }
    
    myCB cb;
}

class YY(ARGS...) : TT!(ARGS)
{
    void doICB(int a, ARGS args)
    {
        writeln("  a = ", a);
        cb(args);
    }
}

void show(int a, string b)
{
    writeln("a == ", a, "   b is : ", b);
}

alias MYT = TT!(int,string);
alias NYY = YY!(int,string);

void shows(string str)
{
    writeln("shows is : ", str);
}

void main()
{
    MYT a = new MYT();
    a.cb = toDelegate(&show);
    TT!string b = new TT!string();
    b.cb = toDelegate(&shows);
    a.doCB(5,"a.doCB");
    b.doCB("b.do    CB");
    NYY n = new NYY();
    n.cb = toDelegate(&show);
    n.doICB(10,20,"?????????/");
}
